//
//  RCCustomConversationListViewController.m
//  test2
//
//  Created by Admin on 2021/6/14.
//  Copyright © 2021年 Admin. All rights reserved.
//

#import "RCCustomConversationListViewController.h"

@interface RCCustomConversationListViewController()

@end

@implementation RCCustomConversationListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 设置需要显示列表显示那些类型的会话
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"开启单聊" style:UIBarButtonItemStylePlain target:self action:@selector
                                    (rightBarButtonItemPressed:)];
    self.navigationItem.rightBarButtonItem = rightButton;
}

- (void)rightBarButtonItemPressed:(id)sender {
    RCConversationViewController *conversationVC = [[RCConversationViewController alloc] init];
    conversationVC.conversationType = ConversationType_PRIVATE;
    conversationVC.targetId = @"test";
    [self.navigationController pushViewController:conversationVC animated:YES];
    
}

- (void)onSelectedTableRow:(RCConversationModelType)conversationModelType conversationModel:(RCConversationModel *)model atIndexPath:(NSIndexPath *)indexPath {
    
    RCConversationViewController *conversationVC = [[RCConversationViewController alloc] initWithConversationType:model.conversationType targetId:model.targetId];
    //会话标题
    conversationVC.title = @"IMChat!!!";
    conversationVC.conversationType = model.conversationType;
    conversationVC.targetId = model.targetId;
    conversationVC.title = model.conversationTitle;
    [self.navigationController pushViewController:conversationVC animated:YES];
}

@end
